#include "QReceptor.h"

QReceptor::QReceptor()
{
    type = 2;
    switchedOn = false;
    this->setMemPot(10);
}

void QReceptor::addTempMemPot(double)
{
    ;
}
void QReceptor::rotMemPot(void)
{
    if (switchedOn)
    {
        memPot = tempMemPot;
    }
    else
    {
        memPot = 0;
    }
}

int QReceptor::getType(void)
{
    return type;
}

QString QReceptor::getState(void)
{
    QString text;
    if (switchedOn)
    {
        text="Switched On";
    }
    else
    {
        text="Switched Off";
    }
    return text;
}

void QReceptor::switchMode()
{
    QString text;
    switchedOn = !switchedOn;
    if (!switchedOn)
    {
        tempMemPot = memPot;
        text="Switched Off";
    }
    else
    {
        text="Switched On";
    }
    emit modeChanged(switchedOn);
    emit stateChanged(text);
}
void QReceptor::setMemPot(double _memPot)
{
    memPot = _memPot;
    tempMemPot = _memPot;
    emit memPotChanged(memPot);
}
